<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:rich="http://richfaces.org/rich">

	<ui:composition template="/WEB-INF/template.xhtml">
		
		<ui:define name="body">
			<h2>Task Assignment</h2>
            <f:subview id="no_pooled_tasks" rendered="#{empty pooledTaskInstanceList}">
                <p>There are no pooled tasks to be assigned.</p>
            </f:subview>
            <f:subview id="pooledTasks" >
            	<h:dataTable value="${pooledTaskInstanceList}" var="task" rendered="#{!empty pooledTaskInstanceList}">
            		<h:column>
							<f:facet name="header">recordId</f:facet>
							<h:outputText value="#{task.variables['recordId']}" />
						</h:column>
						<h:column>
							<f:facet name="header">customer</f:facet>
							<h:outputText value="#{task.variables['customerName']}" />
						</h:column>
						<h:column>
							<f:facet name="header">depositAmount</f:facet>
							<h:outputText value="#{task.variables['depositAmount']}" />
						</h:column>
						<h:column>
							<s:button value="Assign" action="#{pooledTask.assignToCurrentActor}" taskInstance="#{task}"/>
						</h:column>
            	</h:dataTable>
            </f:subview>
            
		
			<h2>Deposits Acceptance</h2>
            <f:subview id="no_deposits" rendered="#{empty taskInstanceListForType['accept']}">
                <p>There are no deposits to be accepted.</p>
            </f:subview>
		
			<f:subview id="adminPage">
				<s:div>
					<h:dataTable rendered="#{not empty taskInstanceListForType['accept']}"
								 value="#{taskInstanceListForType['accept']}" var="task">
						<h:column>
							<f:facet name="header">recordId</f:facet>
							<h:outputText value="#{task.variables['recordId']}" />
						</h:column>
						<h:column>
							<f:facet name="header">customer</f:facet>
							<h:outputText value="#{task.variables['customerName']}" />
						</h:column>
						<h:column>
							<f:facet name="header">depositAmount</f:facet>
							<h:outputText value="#{task.variables['depositAmount']}" />
						</h:column>
						<h:column>
							<s:button action="#{accountdeposits.accept.review}" taskInstance="#{task}"  value="Review"/>
						</h:column>
					</h:dataTable>
				</s:div>
			</f:subview>
		</ui:define>
	
		<ui:define name="topnav">
            <ui:include src="/WEB-INF/incl/admin_nav.xhtml">
                <ui:param name="page" value="deposits_admin" />
            </ui:include>
        </ui:define>

        <ui:define name="sidebar">
            <ui:include src="/WEB-INF/incl/login.xhtml" />
            <ui:include src="/WEB-INF/incl/stats.xhtml" />
            <ui:include src="/WEB-INF/incl/processmenu.xhtml" />
        </ui:define>

	</ui:composition>

</html>